/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.thienloc.omap.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author GiangLT
 */
@Entity
@Table(name = "SERVICE_TEMPLATE", catalog = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ServiceTemplate.findAll", query = "SELECT s FROM ServiceTemplate s"),
    @NamedQuery(name = "ServiceTemplate.findById", query = "SELECT s FROM ServiceTemplate s WHERE s.id = :id"),
    @NamedQuery(name = "ServiceTemplate.findByServiceName", query = "SELECT s FROM ServiceTemplate s WHERE s.serviceName = :serviceName"),
    @NamedQuery(name = "ServiceTemplate.findByTemplate", query = "SELECT s FROM ServiceTemplate s WHERE s.template = :template")})
public class ServiceTemplate implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID")
    private Long id;
    @Size(max = 40)
    @Column(name = "SERVICE_NAME")
    private String serviceName;
    @Size(max = 1000)
    @Column(name = "TEMPLATE")
    private String template;

    public ServiceTemplate() {
    }

    public ServiceTemplate(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getServiceName() {
        return serviceName;
    }

    public void setServiceName(String serviceName) {
        this.serviceName = serviceName;
    }

    public String getTemplate() {
        return template;
    }

    public void setTemplate(String template) {
        this.template = template;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ServiceTemplate)) {
            return false;
        }
        ServiceTemplate other = (ServiceTemplate) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.thienloc.omap.entity.ServiceTemplate[ id=" + id + " ]";
    }
    
}
